

function test1()
	local a = 1231.12391
	local res = a/ 360 
	res = a % 360 
	print(res)

	
	
	local betLevels = {200,500,2000,5000,10000,50000,200000,500000,2000000}
	local function resolveMoney(money)
	    local list = {}
	    local len = #betLevels
	    local function pickUnit(unit)
		    local a,b = math.modf(money / unit)
		    if a ~= 0 then
		        money = money - a * unit
		        for i= 1,a do
		            table.insert(list,unit)
		        end
		    end
		end
	    for i = len,1,-1 do 
	    	local unit = betLevels[i]
	        pickUnit(unit)
	    end
	    for _,v in ipairs(list) do
	        print(v)
	    end
	end

	resolveMoney(5200400)

end
-- test1()
function test2()

	tab1 = {}
	table.insert(tab1,{1,2,3,4,a=1})
	table.insert(tab1,{a=2})
	table.insert(tab1,{a=3})
	
	print("haha",#tab1[1])

	res = table.remove(tab1,1)
	print(res.a)
	res = table.remove(tab1,1)
	print(res.a)
	table.insert(tab1,4)
	res = table.remove(tab1,1)
	print(res.a)
	res = table.remove(tab1,1)


end
-- test2()

function test3( ... )
	local queue = {list = {}}
	function queue.push(data)
	  table.insert(queue.list,data)
	end
	function queue.pop(data)
	  return table.remove(queue.list,1)
	end

	print("####")
	queue.push(1)
	queue.push(2)
	queue.push(3)
	res = queue.pop()
	print(res)
	res = queue.pop()
	print(res)
	queue.push(4)
	queue.push(5)
	res = queue.pop()
	print(res)
	res = queue.pop()
	print(res)

	print("####")
	res = (0 - 5) % 6 + 1
	print(res)
end

-- test3()      math.fmod(nowRot, 360)
local res = math.fmod (-729, 360)
print(res)



